<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">

    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 100%;
            text-align: center;
            margin: auto;
        }

        #mydiv {
            width: 100px;
            height: 100px;
            background-color: aqua;
            margin: auto;
        }
    </style>
</head>

<body>
    <div class="box">
        <button onclick="cheight()">变高</button>
        <button onclick="cwidth()">变宽</button>
        <button onclick="ccolor()">变色</button>
        <button onclick="chide()">隐藏</button>
        <button onclick="creset()">重置</button>

        <div id="mydiv"></div>
    </div>
</body>
<script>
    var sdiv = document.getElementById('mydiv')

    function cheight() {
        sdiv.style.height = "200px"
    }
    function cwidth() {
        sdiv.style.width = "200px"
    }
    function chide() {
        sdiv.style.display = "none"
    }
    function ccolor() {
        sdiv.style.backgroundColor = "pink"
    }
    function creset() {
        sdiv.style.cssText = "width:100px;height:100px;backgroundColor:aqua"
    }
</script>

</html>